<%--
    Document   : turnoverfood
    Created on : Dec 5, 2011, 5:31:47 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*, java.text.NumberFormat, Beans.NhanVien, Beans.ThamSoHT,Models.ThamSoHT_Model, Models.NhanVien_Model, Models.TienTe_Model"%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'totalturnover', 'departmentmanager', 'signature', 'authorizedofficer', 'quantity', 'nameofuser', 'period', 'reportdate', 'turnoveruser', 'turnover', 'order', 'nameofuser' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String authorizedofficer = mdsts[0].getTenTS();
            String departmentmanager = mdsts[1].getTenTS();
            String nameofuser = mdsts[2].getTenTS();
            String order = mdsts[3].getTenTS();
            String period = mdsts[4].getTenTS();
            String quantity = mdsts[5].getTenTS();
            String reportdate = mdsts[6].getTenTS();
            String signature = mdsts[7].getTenTS();
            String totalturnover = mdsts[8].getTenTS();
            String turnover = mdsts[9].getTenTS();
            String turnoveruser = mdsts[10].getTenTS();

            Vector v1 = (Vector) request.getAttribute("Report1");
            Vector v2 = (Vector) request.getAttribute("Report2");
            Vector v3 = (Vector) request.getAttribute("Report3");
            String ngaybd = (String) request.getAttribute("ngaybd");
            String ngaykt = (String) request.getAttribute("ngaykt");
            String tennv = (String) request.getAttribute("tennv");
            String sl = (String) request.getAttribute("sl");
            //String doanhthu = (String) request.getAttribute("doanhthu");
            String tendn = (String) request.getAttribute("tendn");
            String diachi = (String) request.getAttribute("diachi");
            String sodt = (String) request.getAttribute("sodt");
            String ngaygio = (String) request.getAttribute("ngaygio");
            NumberFormat nf = NumberFormat.getNumberInstance(Locale.FRENCH);
            int count = 0;
%>

<html>
    <head>
        <link href="css/statics.css" type="text/css" rel="stylesheet" />
        <title>i-Order</title>
        <link rel="icon" href="images/icon.png" />
        <link rel="shortcut icon" href="images/icon.png" />
        <link rel="apple-touch-icon" href="images/icon.png"/>
        <link rel="apple-touch-icon-precomposed" href="images/icon.png"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <div style=" width: 57%; background: #f5e3c0; margin-left: 260px; padding: 10px;">
            <div style=" " class="companystatics">
                <div style="text-align: left; text-transform: uppercase; font-size: 20px; margin-bottom: 10px; color: #242323; font-weight: bold;"><%=tendn%></div>
                <div style="text-align: left; margin-bottom: 5px; color: #242323;"><img style=" margin-right: 8px;" alt="" src="images/download2.png"><%=diachi%></div>
                <div style="text-align: left; color: #242323;"><img style=" margin-right: 5px;" alt="" src="images/phone.png"><%=sodt%></div>
            </div>
            <div style=" color: #906102; text-transform: uppercase; clear: both; font-size: 24px; margin-bottom: 15px;  font-weight: bold; text-align: center;"><%=turnoveruser%></div>
            <div class="content">
                <table  style=" margin-bottom: 30px; margin-left: 230px;">
                    <tr>
                        <td style=" width: 105px;  color: #242323;"><%=period%> :</td>
                        <%  if (!ngaybd.equals("")) {%>
                        <td style="color: #242323;"><%=ngaybd%>  -  <%=ngaykt%></td>
                        <%  }%>
                    </tr>
                    <tr>                        
                        <td style="width: 105px;   color: #242323;"><%=nameofuser%> :</td>
                        <%  if (!tennv.equals("")) {%>
                        <td style=" color: #242323;"><%=tennv%></td>
                        <%  }%>
                    </tr>
                    <tr>
                        <td style="width: 105px;   color: #242323;"><%=quantity%> :</td>
                        <%  if (!sl.equals("")) {%>
                        <td style="  color: #242323;"><%=sl%></td>
                        <%  }%>
                    </tr>
                </table>
                <div style="padding: 20px; border: 1px solid #242323; border-top:2px double #242323; border-bottom: 2px double #242323; ">
                    <table id="tk" class="mytable" border="0" cellpadding="0" cellspacing="0" style=" margin-left: 15px;">
                        <thead>
                        <th style=" width: 13%;padding-left: 10px;" class="titlestaticss"><%=order%></th>
                        <th style=" width: 63%;" class="titlestaticss"><%=nameofuser%></th>
                        <th style=" padding-right: 10px;" class="titlestaticss"><%=turnover%>     (<%=TienTe_Model.LayKyHieuTT(langid)%>)</th>
                        </thead>
                        <%
                                    for (int i = 0; i < v1.size(); i++) {
                                        Beans.CTHoaDon cthd = (Beans.CTHoaDon) v1.elementAt(i);
                                        count = count + 1;
                        %>
                        <tr>
                            <td style=" padding-left: 10px;"><%=count%></td>
                            <td style=" "><%=NhanVien_Model.LayTenNV(cthd.getMaNVDB())%></td>
                            <td style=""><div style="float: left; width: 90px; text-align: right; "><%=nf.format(cthd.getThanhTien())%></div></td>
                        </tr>
                        <%  }%>
                        <%
                                    for (int i = 0; i < v2.size(); i++) {
                                        Beans.CTHoaDon cthd = (Beans.CTHoaDon) v2.elementAt(i);
                                        count = count + 1;
                        %>
                        <tr>
                            <td style=" padding-left: 10px;"><%=count%></td>
                            <td style=" "><%=NhanVien_Model.LayTenNV(cthd.getMaNVDB())%></td>
                            <td style=""><div style="float: left; width: 90px; text-align: right; "><%=nf.format(cthd.getThanhTien())%></div></td>
                        </tr>
                        <%  }%>
                        <%
                                    for (int i = 0; i < v3.size(); i++) {
                                        Beans.CTHoaDon cthd = (Beans.CTHoaDon) v3.elementAt(i);
                                        count = count + 1;
                        %>
                        <tr>
                            <td style=" padding-left: 10px;"><%=count%></td>
                            <td style=" "><%=NhanVien_Model.LayTenNV(cthd.getMaNVDB())%></td>
                            <td style=""><div style="float: left; width: 90px; text-align: right; "><%=nf.format(cthd.getThanhTien())%></div></td>
                        </tr>
                        <%  }%>

                    </table>
                </div>
                <div style=" padding-top: 30px; background: #f5e3c0; height: 100px; padding-left: 5px; ">
                    <div style=" width: 300px; float: left;">
                        <label><%=reportdate%> :</label> <%=ngaygio%>
                    </div>
                    <div style=" width: 230px; float: left;">
                        <label><%=authorizedofficer%></label><br /><br />
                        <div style=" padding-left: 30px;"><%=signature%></div>
                    </div>
                    <div style="width: 150px; float: left;">
                        <label><%=departmentmanager%></label><br /><br />
                        <div style=" padding-left: 30px;"><%=signature%></div>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>


